<template>
  <div class="container">
    <div class="page-title">消息中心</div>
    <div class="info-wrap">
      <UserNotification v-if="!isPM"></UserNotification>
      <PrivateMessage v-else></PrivateMessage>
    </div>
  </div>
</template>
<script>
import UserNotification from "../components/UserNotification.vue";
import PrivateMessage from "../components/PrivateMessage.vue";
export default {
  name: "UserInfo",
  components: { UserNotification, PrivateMessage },
  data() {
    return {
      isLogin: false,
      isPM: false,
    };
  },
  created() {
    // this.$router.push("/usercenter/messagecenter/privatemessage");
  },
  methods: {
  },
  watch: {
    $route(to, from) {
      console.log(from.path + " to " + to.path);
      if (to.path.slice(0,40) === "/usercenter/messagecenter/privatemessage") {
        this.isPM = true;
      } else {
        this.isPM = false;
      }
    },
  },
};
</script>
  <style scoped>
.info-wrap {
  padding: 20px 40px;
  box-shadow: #dedede 0px 0px 20px;
}
.page-title {
  margin: 0 0 40px 0;
  font-size: 22px;
  font-weight: 600;
  color: #3d3daf;
}
.container {
  letter-spacing: 1px;
  width: 1000px;
}
</style>